<?php
namespace app\v1\controller;

use think\Controller;
use think\Db;
use think\Loader;

class User extends Controller
{
    public function get()
    {
        
        $postData = input('get.');

    	$validate = Loader::validate('user');

		if(!$validate->check($postData)){

		    return json(['code'=>10003,'msg'=>$validate->getError()]);
		}

		$user = Db::name('user')->find(input('uid'));

		if($user){
			return json(['code'=>0,'data'=>$user]);
		}else{
			return json(['code'=>10004,'msg'=>'用户不存在']);
		}
    }
}
